import { ref, onMounted, onBeforeUnmount, reactive } from "vue";
import { getDeviceList, getFeatureList } from "@/api/modules/new";

export const getInitData = () => {
  const initData = reactive({
    featureList: [],
    deviceList: []
  });

  onMounted(() => {
    getDeviceList().then(res => {
      // @ts-ignore
      initData.deviceList = res;
    });
    // @ts-ignore
    getFeatureList().then(res => {
      // @ts-ignore
      initData.featureList = res;
    });
  });
  return { initData };
};
